package cn.edu.lsnu.mbti.util;



public class MajorUtils {

    /**
     * majors: [工程,计算机,金融,物理,化学,生物]
     * @param majors
     * @return
     */
    public static String[] getMajor(String majors){
        //截取字符串 去掉中括号
        String subMajors = majors.substring(1,majors.length()-1);
        //分割字串，得到专业名字的字符数组
        String[] split = subMajors.split(",");

        return split;
    }



    public static void main(String[] args) {
        String[] department = getMajor("[工程,计算机,金融,物理,化学,生物]");
        for (String s : department) {
            System.out.println(s);
        }
    }
}
